package com.shop.common.enums.store;

import lombok.Getter;

/**
 * 订单状态变更类型
 */
@Getter
public enum StoreOrderStatusChangeTypeEnum {

    CACHE_KEY_CREATE_ORDER("cache_key_create_order", "订单生成"),
    CHECK_ORDER_OVER("check_order_over", "用户评价"),
    DELIVERY_GOODS("delivery_goods", "已发货"),        // 已发货 快递公司：%s 快递单号：%s
    DISTRIBUTION("distribution", "修改发货信息"),       // 修改发货信息 快递公司：%s 快递单号：%s
    PAY_SUCCESS("pay_success", "用户付款成功"),
    REFUND_PRICE("refund_price", "退款"),             // 退款 给用户%s元
    USER_TAKE_DELIVERY("user_take_delivery", "用户已收货"),
    USER_DELETE("user_delete", "用户已删除"),
    ;

    private String key;
    private String message;

    StoreOrderStatusChangeTypeEnum(String key, String message) {
        this.key = key;
        this.message = message;
    }

    public static StoreOrderStatusChangeTypeEnum val(String key) {
        for (StoreOrderStatusChangeTypeEnum enumObj : StoreOrderStatusChangeTypeEnum.values()) {
            if(enumObj.key.equals(key)) {
                return enumObj;
            }
        }
        return null;
    }
}
